﻿using System;
using System.Collections;
using System.Collections.Generic;
using Czx.Common.Utils;
using Hr.Interfaces;
using Hr.Models;

namespace Hr.Business
{
    public class EmployeeClockHelperImpl : ManagerBase<EmployeeClock>, IEmployeeClockHelper
    {
        public IList<EmployeeClock> GetList(Hashtable queryParams)
        {
            string statementName = "EmployeeClockQuery";
            int page = ConvertHelper.ToInt32(queryParams["page"], 0);
            int rows = ConvertHelper.ToInt32(queryParams["rows"], 0);
            LogRuntimeSql(statementName, queryParams);
            if (rows > 0)
            {
                return Mapper.QueryForList<EmployeeClock>(statementName, queryParams, page * rows, rows);
            }
            else
            {
                return Mapper.QueryForList<EmployeeClock>(statementName, queryParams);
            }
        }
    }
}
